package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.UserPeopleMapper;
import com.ruoyi.system.domain.UserPeople;
import com.ruoyi.system.service.IUserPeopleService;

/**
 * 用户Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-09-21
 */
@Service
public class UserPeopleServiceImpl implements IUserPeopleService 
{
    @Autowired
    private UserPeopleMapper userPeopleMapper;

    /**
     * 查询用户
     * 
     * @param id 用户主键
     * @return 用户
     */
    @Override
    public UserPeople selectUserPeopleById(Long id)
    {
        return userPeopleMapper.selectUserPeopleById(id);
    }

    /**
     * 查询用户列表
     * 
     * @param userPeople 用户
     * @return 用户
     */
    @Override
    public List<UserPeople> selectUserPeopleList(UserPeople userPeople)
    {
        return userPeopleMapper.selectUserPeopleList(userPeople);
    }

    /**
     * 新增用户
     * 
     * @param userPeople 用户
     * @return 结果
     */
    @Override
    public int insertUserPeople(UserPeople userPeople)
    {
        userPeople.setCreateTime(DateUtils.getNowDate());
        return userPeopleMapper.insertUserPeople(userPeople);
    }

    /**
     * 修改用户
     * 
     * @param userPeople 用户
     * @return 结果
     */
    @Override
    public int updateUserPeople(UserPeople userPeople)
    {
        userPeople.setUpdateTime(DateUtils.getNowDate());
        return userPeopleMapper.updateUserPeople(userPeople);
    }

    /**
     * 批量删除用户
     * 
     * @param ids 需要删除的用户主键
     * @return 结果
     */
    @Override
    public int deleteUserPeopleByIds(Long[] ids)
    {
        return userPeopleMapper.deleteUserPeopleByIds(ids);
    }

    /**
     * 删除用户信息
     * 
     * @param id 用户主键
     * @return 结果
     */
    @Override
    public int deleteUserPeopleById(Long id)
    {
        return userPeopleMapper.deleteUserPeopleById(id);
    }
}
